//
//  GameController.cpp
//  Frog Jump
//
//  Created by Tri Vo on 7/25/13.
//
//

#include "GameController.h"

USING_NS_CC;

void GameController::popScene(CCScene *scene) {
    CCDirector::sharedDirector()->replaceScene(CCTransitionSlideInL::create(0.3f, scene));
}
//
void GameController::pushScene(CCScene *scene) {
    CCDirector::sharedDirector()->replaceScene(CCTransitionSlideInR::create(0.3f, scene));
}

void GameController::replaceScene(CCScene *pScene) {
    CCDirector::sharedDirector()->replaceScene(CCTransitionFade::create(0.3f, pScene));
}

CCSize GameController::getWinSize() {
    return CCDirector::sharedDirector()->getWinSize();
}

int GameController::getDeviceType() {
    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    if (winSize.width == 960) {
        return IPHONE_HD;
    } else if(winSize.width == 1136) {
        return IPHONE_5;
    } else if(winSize.width == 1024) {
        return IPAD;
    } else if(winSize.width == 2048) {
        return IPAD_HD;
    }
    return IPHONE;
}

bool GameController::getMusicState() {
    bool retVal = CCUserDefault::sharedUserDefault()->getBoolForKey(SET_MUSIC);
    return retVal;
}

bool GameController::getSoundState() {
    bool retVal = CCUserDefault::sharedUserDefault()->getBoolForKey(SET_SOUND);
    return retVal;
}

int GameController::getNumberOfLevel() {
    return 10;
}